<?php 
header("Content-Type: text/html; charset=utf-8"); 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="./style.css" rel="stylesheet" type="text/css">
</head>

<body>
<fieldset><legend>Configuration des distances</legend>
<form action="./setDistances.php" method="post" name="form4">
<table class="principale">
	<tr>
		<th colspan="3"><?php
		if(isset($_POST['login']) && isset($_POST['password']) ){
			$login=$_POST['login'];
			$password=$_POST['password'];
			if($login=="set" && $password="distance"){
				require_once("bd_utils.php");
				$obj_utils=new bd_utils();
					
					
				$obj_utils->connect();
				if(isset($_POST['small']) && isset($_POST['big'])){
					$smallDist=$_POST['small'];
					$bigDist=$_POST['big'];
				}
				if($smallDist>$bigDist){
					$temp=$smallDist;
					$smallDist=$bigDist;
					$bigDist=$temp;
				}
				$obj_utils->setDistances($smallDist,$bigDist);
					
				$obj_utils->close();
				echo "Les distances courrantes sont ".$smallDist." & ".$bigDist;
					
			}

			?> <?php
		}

		?>
		
		</th>
	</tr>
	<tr>
		<td>Small distance: <input name="small" type="text" /> </td>
		<td>Big distance: <input name="big" type="text" /></td>
		<td><input name="submitlog" type="submit" value="Set Distances"/></td>
	</tr>
	<tr>
		<td colspan="3" align="center"><a href="./index.php?page=inscriptions.php">Retour à l'index</a></td>
	</tr>
</table>
<input type="hidden" name="login" size="10" value="set"/>
<input type="hidden" name="password" size="10" value="distance"/>
</form>
</fieldset>
</body>
</html>
